The PHP variant of this widget was introduced in 0.27.0.
Using NumberInputWidget has the advantage that HTMLFloatField and
HTMLIntField can now be infused as a JavaScript NumberInputWidget.
Bug: T203656
Change-Id: I5d6a913de38d12a21c9bfb1ce9790574d98a5a1b
return true;
}
+
+ protected function getInputWidget( $params ) {
+ return new OOUI\NumberInputWidget( $params );
+ }
}
switch ( $this->mParams['type'] ) {
case 'int':
$type = 'number';
+ $attribs['step'] = 1;
break;
case 'float':
$type = 'number';
}
$type = $this->getType( $attribs );
+ if ( isset( $attribs['step'] ) && $attribs['step'] === 'any' ) {
+ $attribs['step'] = null;
+ }
return $this->getInputWidget( [
'id' => $this->mID,